<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	<%@ taglib prefix ="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>添加班级</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/layui/css/layui.css"
	media="all">
</head>
<body>
	<form class="layui-form layui-form-pane" action="" enctype="multipart/form-data">
<%--		<div class="layui-form-item">--%>
<%--			<label class="layui-form-label">班级编号</label>--%>
<%--			<div class="layui-input-inline">--%>
<%--				<input type="text" name="cid" lay-verify="required"--%>
<%--					placeholder="请输入" autocomplete="off" class="layui-input">--%>
<%--			</div>--%>
<%--		</div>--%>
		<div class="layui-form-item">
			<label class="layui-form-label">班级名</label>
			<div class="layui-input-inline">
				<input type="text" name="cname" lay-verify="required"
					   placeholder="请输入" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">入学年份</label>
			<div class="layui-input-inline">
				<input type="text" name="year" lay-verify="required"
					placeholder="请输入" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">所属学部</label>
			<div class="layui-input-inline">
				<input type="text" name="department" lay-verify="required"
					placeholder="请输入" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="submit" class="layui-btn" lay-submit=""
					lay-filter="demo1">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</body>
<script src="${pageContext.request.contextPath}/layui/layui.js"></script>
<script>
layui.use([ 'upload', 'element', 'layer' ],function() {
		var $ = layui.jquery, 
		upload = layui.upload, 
		element = layui.element, 
		layer = layui.layer,
		form = layui.form;
		//提交表单
		form.on('submit(demo1)', function(data){
		 //console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
		  $.ajax({
			  url:"AdminAddClazzServlet2",
			  data:data.field,
			  type:"post",
		  })
		  window.parent.location.reload()//让父窗口重新加载
		  return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
		});
})
</script>
</html>